﻿using Abp.Application.Services;
using Abp.Application.Services.Dto;
using Aspose.Words;
using MyCompanyName.AbpZeroTemplate.Authorization.Users.Dto;
using MyCompanyName.AbpZeroTemplate.Prm.Admin.Dto;
using MyCompanyName.AbpZeroTemplate.Prm.Project.Dto;
using MyCompanyName.AbpZeroTemplate.Prm.Project.ProjectTaskExport;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace MyCompanyName.AbpZeroTemplate.Prm.Project
{
    public interface IProjectTaskAppService : IApplicationService
    {
        /// <summary>
        /// 问题导入
        /// </summary>
        /// <returns></returns>
        GetImportOutPut Import();
        /// <summary>
        /// 根据ID获取
        /// </summary>
        /// <param name="projectTaskId"></param>
        /// <returns></returns>
        Task<GetProjectTaskOutPut> Get([FromUri]int projectTaskId);
        /// <summary>
        /// 得到所有的问题
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<GetProjectTaskOutPut> GetTasks([FromUri]GetProjectTaskInPut input);

        /// <summary>
        /// 上传问题回复
        /// </summary>
        /// <returns></returns>
        Task UploadReply();

        /// <summary>
        /// 创建一个问题回复
        /// </summary>
        /// <returns></returns>
        Task CreateReply(CreateTaskReply input);

        /// <summary>
        /// 获取问题回复
        /// </summary>
        /// <param name="projectTaskId"></param>
        /// <returns></returns>
        List<GetProjectTaskReplyOutPut> GetReplys([FromUri]int projectTaskId);

        /// <summary>
        /// 设置问题为已完成
        /// </summary>
        /// <param name="projectTaskId"></param>
        /// <returns></returns>
        Task SetFinsh(int projectTaskId);
        /// <summary>
        /// 标记问题归档
        /// </summary>
        /// <param name="projectTaskId"></param>
        /// <returns></returns>
        Task SetArchived(int projectTaskId);
        /// <summary>
        /// 关注任务
        /// </summary>
        /// <param name="projectTaskId"></param>
        /// <param name="projectId"></param>
        /// <returns></returns>
        Task FollowerTask([FromUri]int projectTaskId, int projectId);

        Task RemoveFollower([FromUri]int followerId);

        /// <summary>
        /// 删除问题
        /// </summary>
        /// <param name="projectTaskId"></param>
        /// <returns></returns>
        Task DeleteTask(int projectTaskId);

        /// <summary>
        /// 导出问题
        /// </summary>
        /// <param name="projectId"></param>
        void GetExport([FromUri]GetExportInPut input);

        /// <summary>
        /// 编辑问题
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task EditTask(EditProjectTaskInPut input);


        Task EditTaskQuan(EditProjectTaskInPut input);


        /// <summary>
        /// 下载问题导入模板
        /// </summary>
        void GetDownTemplate();

        /// <summary>
        /// 问题导入确认
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task ImportConfirm(ProjectTaskImportConfirmInPut input);

        /// <summary>
        /// 得到项目任务标签
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<KeyValuePair<string, int>> GetTaskTags([FromUri]int projectId);

        /// <summary>
        /// 获取子任务
        /// </summary>
        /// <returns></returns>
        List<GetSubTaskOutPut> GetSubTasks([FromUri]int taskId);

        /// <summary>
        /// 根据项目ID获取项目角色成员树
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        Task<List<GetProjectTeamCheckedTreeDto>> GetRoleUserTree([FromUri]int projectId, int taskId);

        /// <summary>
        /// 得到我关注的问题
        /// </summary>
        /// <returns></returns>
        List<GetWorkProjectTaskOutPut> GetMyFollower();

        /// <summary>
        /// 得到我待办的工作
        /// </summary>
        /// <returns></returns>
        List<GetWorkProjectTaskOutPut> GetMyWork();


        Task BatchEditTask(BatchEditTaskInPut input);

        List<MyCompanyName.AbpZeroTemplate.Gantt.Dto.GetTaskOutPut> GetAllTasks();

        /// <summary>
        /// 到期未完成的邮件提醒
        /// </summary>
        void GetMailTaskToClose();
        int GetNewTaskCount(int projectId, DateTime dts);
        int GetCloseTaskCount(int projectId, DateTime dts);
    }
}